package model;

import java.util.Collection;
import java.util.Vector;

public class ConcreteExecutionSequence extends ExecutionSequence{

	private final Collection<Transition> transitions;
	
	public ConcreteExecutionSequence(final Transition firstTransition) {
		this.transitions = new Vector<Transition>();
		this.transitions.add(firstTransition);
	}
	
	public void addTransition(final Transition transition){
		this.transitions.add(transition);
	}
	
	public Collection<Transition> getTransitions(){
		return new Vector<Transition>(this.transitions);
	}

	@Override
	public boolean isRealizable(final System system, final Marking marking) {
		return system.isActivated(marking, this.transitions);
	}

	@Override
	public Marking getMarkingAfterExecution(final System system, final Marking marking) throws NotActivatedException {
		return system.getPostExecutionMarking(marking, this.transitions);
	}
}
